package com.leecode.arrAndSort;

public class MaxAlwaysAddArrLengthMain {
	public static void main(String[] args) {
		System.out.println(findLengthOfLCIS(new int[]{1, 3, 5, 4, 7}));
	}

	public static int findLengthOfLCIS(int[] nums) {
		if (nums.length==0) {
			return 0;
		}
		int i = 0, j = 0;
		int max = 1,temp;

		while (++j <= nums.length - 1) {
			if (nums[j] > nums[j-1]) {
				temp=j-i+1;
				if (temp > max) {
					max=temp;
				}
			}else{
				i=j;
			}
		}

		return max;
	}
}
